<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="description" content="">
        <meta name="keywords" content="">
        <meta name="author" content="江阳小道">
        <meta name="viewport" content="width=device-width, initial-scale=0.5, maximum-scale=0.5, user-scalable=no">
        <title>深呼吸体验之旅摄影作品大赛</title>
        <!-- Set render engine for 360 browser -->
        <meta name="renderer" content="webkit">

        <!-- No Baidu Siteapp-->
        <meta http-equiv="Cache-Control" content="no-siteapp"/>
        <link rel="stylesheet" href="__PUBLIC__/css/reset.css">
        <link rel="stylesheet" href="__PUBLIC__/css/base.css">
        <link rel="stylesheet" href="__PUBLIC__/css/main.css">

    </head>
    <body>
        <div class="gift-page">
            <a class="open-prize" href="javascript:;" onclick="opengift();"><img src="__PUBLIC__/img/btn-open-prize.png" alt=""></a>
        </div>


        <div class="no-prize-dialog prize-remind translucent-bg no-prize" id="no1" style="display: none" >
            
            <div class="content">
                <a class="close" href="#"></a>
                <div class="prize-info-wrap">
                    <div class="prize-info">
                        <img src="__PUBLIC__/img/hf100.png" alt="">
                    </div>
                </div>
                <div class="footer" style="margin-bottom: 180px;text-align: center">

                    <input type="text" name="phone" id="phone" value="" placeholder="手机号：" /><br />
                    <input type="text" name="name" id="name" value="" placeholder="姓名：" /><br />
                    <input type="hidden" name="prize_id" value="{$info['prize_id']}"/>
                    <!-- <a class="share"><img src="__PUBLIC__/img/share-friend.png" alt=""></a> -->
                    <a class="home" href="javascript:;" onclick="submit_result(this)">
                    <img src="__PUBLIC__/img/btn-submit.png" alt=""></a>
                </div>
            </div>

        </div>



        <div class="no-prize-dialog prize-remind translucent-bg no-prize" id="no2" style="display: none" >
            <div class="content">
                <a class="close" href="#"></a>
                <div class="prize-info-wrap">
                    <div class="prize-info">
                        <img src="__PUBLIC__/img/hf50.png" alt="">
                    </div>
                </div>
                <div class="footer" style="margin-bottom: 180px;text-align: center">

                    <input type="text" name="phone" id="phone" value="" placeholder="手机号：" /><br />
                    <input type="text" name="name" id="name" value="" placeholder="姓名：" /><br />
                    <input type="hidden" name="prize_id" value="{$info['prize_id']}"/>
                    <!-- <a class="share"><img src="__PUBLIC__/img/share-friend.png" alt=""></a> -->
                    <a class="home" href="javascript:;" onclick="submit_result(this)">
                    <img src="__PUBLIC__/img/btn-submit.png" alt=""></a>
                </div>
            </div>
        </div>

        <div class="no-prize-dialog prize-remind translucent-bg no-prize" id="no3" style="display: none" >
            <div class="content">
                <a class="close" href="#"></a>
                <div class="prize-info-wrap">
                    <div class="prize-info">
                        <img src="__PUBLIC__/img/hf30.png" alt="">
                    </div>
                </div>
                <div class="footer" style="margin-bottom: 180px;text-align: center">

                    <input type="text" name="phone" id="phone" value="" placeholder="手机号：" /><br />
                    <input type="text" name="name" id="name" value="" placeholder="姓名：" /><br />
                    <input type="hidden" name="prize_id" value="{$info['prize_id']}"/>
                    <!-- <a class="share"><img src="__PUBLIC__/img/share-friend.png" alt=""></a> -->
                    <a class="home" href="javascript:;" onclick="submit_result(this)">
                    <img src="__PUBLIC__/img/btn-submit.png" alt=""></a>
                </div>
            </div>
        </div>


        <div class="no-prize-dialog prize-remind translucent-bg no-prize" id="no4" style="display: none" >
            <div class="content">
                <a class="close" href="#"></a>
                <div class="prize-info-wrap">
                    <div class="prize-info">
                        <img src="__PUBLIC__/img/hf10.png" alt="">
                    </div>
                </div>
                <div class="footer" style="margin-bottom: 180px;text-align: center">

                    <input type="text" name="phone" id="phone" value="" placeholder="手机号：" /><br />
                    <input type="text" name="name" id="name" value="" placeholder="姓名：" /><br />
                    <input type="hidden" name="prize_id" value="{$info['prize_id']}"/>
                    <!-- <a class="share"><img src="__PUBLIC__/img/share-friend.png" alt=""></a> -->
                    <a class="home" href="javascript:;" onclick="submit_result(this)">
                    <img src="__PUBLIC__/img/btn-submit.png" alt=""></a>
                </div>
            </div>
        </div>



        <div class="no-prize-dialog prize-remind translucent-bg no-prize" id="no7" style="display: none" >
            <div class="content">
                <a class="close" href="#"></a>
                <div class="prize-info-wrap">
                    <div class="prize-info">
                        <img src="__PUBLIC__/img/hf5.png" alt="">
                    </div>
                </div>
                <div class="footer" style="margin-bottom: 180px;text-align: center">

                    <input type="text" name="phone" id="phone" value="" placeholder="手机号：" /><br />
                    <input type="text" name="name" id="name" value="" placeholder="姓名：" /><br />
                    <input type="hidden" name="prize_id" value="{$info['prize_id']}"/>
                    <!-- <a class="share"><img src="__PUBLIC__/img/share-friend.png" alt=""></a> -->
                    <a class="home" href="javascript:;" onclick="submit_result(this)">
                        <img src="__PUBLIC__/img/btn-submit.png" alt=""></a>
                </div>
            </div>
        </div>





        <div class="no-prize-dialog prize-remind translucent-bg no-prize" id="no8" style="display: none" >
            <div class="content">
                <a class="close" href="#"></a>
                <div class="prize-info-wrap">
                    <div class="prize-info">
                        <img src="__PUBLIC__/img/hf20.png" alt="">
                    </div>
                </div>
                <div class="footer" style="margin-bottom: 180px;text-align: center">

                    <input type="text" name="phone" id="phone" value="" placeholder="手机号：" /><br />
                    <input type="text" name="name" id="name" value="" placeholder="姓名：" /><br />
                    <input type="hidden" name="prize_id" value="{$info['prize_id']}"/>
                    <!-- <a class="share"><img src="__PUBLIC__/img/share-friend.png" alt=""></a> -->
                    <a class="home" href="javascript:;" onclick="submit_result(this)">
                        <img src="__PUBLIC__/img/btn-submit.png" alt=""></a>
                </div>
            </div>
        </div>









        <div class="no-prize-dialog prize-remind translucent-bg no-prize" id="no5" style="display: none" >
            <!--<div class="content">-->
                <a class="close" href="#"></a>
                <div class="prize-info">
                    <img src="__PUBLIC__/img/no-prize.png" alt="">
                </div>
                <div class="footer">
                    <a class="home" href="{:U('Home/Index/index')}"><img src="__PUBLIC__/img/home.png" alt=""></a>
                    <a class="share"><img src="__PUBLIC__/img/share-friend.png" alt=""></a>
                </div>
        </div>


        <div class="prize-submit-dialog no-prize-dialog prize-remind translucent-bg no-prize" id="no6" style="display: none" >
            <div class="content-box">
                <a class="close" href="#"></a>
                <!-- <div class="prize-info-wrap">
                    <div class="prize-info">
                        <img src="__PUBLIC__/img/sub.png" alt="">
                    </div>
                </div> -->
                <div class="footer">

                    <a class="share"><img src="__PUBLIC__/img/share-friend.png" alt=""></a>
                    <a class="home" href="{:U('Home/Index/index')}">
                        <img src="__PUBLIC__/img/home.png" alt=""></a>
                </div>
            </div>
        </div>

        <!-- 微信分享 -->
        <div class="wx-share translucent-bg hidden">
            <img src="__PUBLIC__/img/wx-share.png" alt="">
        </div>


        <script src="__PUBLIC__/js/lib/zepto.min.js"></script>
        <script src="__PUBLIC__/js/main.js"></script>
        <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
        <script type="text/javascript">


        </script>

        <script>
            function opengift(){
//                var  te= "{$rest}";
////                alert(te);
////                alert(te);
//                if(te <=0){
//                    alert('您已经抽完一次奖，您没次数啦！');
//                    window.location.href="{:U('Home/Index/index')}";
//
//                }else{

                    //通过AJAX获取抽奖结果
                    param={};
                    $.post("{:U('Member/Member/gift')}",param, function(data, textStatus, xhr) {
                        if(data.error === 0){
                            //显示中奖框
//                            alert(data.info);
                            var arr = eval(data.info);

                            prize_id = arr['prize_id'];
//                            alert(prize_id);
                            switch (prize_id){
                                case '1':
                                    //alert(arr);
//                                    alert(prize_id);
                                    $('#no1').find('input[name="prize_id"]').val(prize_id);
                                    $('#no1').show();
                                    break;
                                case '2':
                                    $('#no2').find('input[name="prize_id"]').val(prize_id);
                                    $('#no2').show();


                                    break;
                                case '3':
                                    $('#no3').find('input[name="prize_id"]').val(prize_id);
                                    $('#no3').show();


                                    break;
                                case '4':
                                    $('#no4').find('input[name="prize_id"]').val(prize_id);
                                    $('#no4').show();


                                    break;
                                case '5':
                                    $('#no7').find('input[name="prize_id"]').val(prize_id);
                                    $('#no7').show();


                                    break;
                                case '6':
                                    $('#no8').find('input[name="prize_id"]').val(prize_id);
                                    $('#no8').show();


                                    break;

                                case 0:
                                    $('#no5').find('input[name="prize_id"]').val(prize_id);
                                    $('#no5').show();


                                    break;
                            }

                        }else{
                            alert(data.msg);
                        }
                    },"json");

//                }




            }



        </script>

        <script>
        function submit_result(obj){
            var name = $(obj).parents(".content").find('input[name="name"]').val();
            var phone = $(obj).parents(".content").find('input[name="phone"]').val(),
                    prize_id = $(obj).parents(".content").find('input[name="prize_id"]').val();
            param = {name:name,phone:phone,prize_id:prize_id};
            $.post("{:U('Member/Member/getprize')}", param, function(data, textStatus, xhr) {
                if(data.error === 0){
//                    alert(data.msg);
                    //成功时
//                title = '幸运儿{$_SESSION["nickname"]}赢得了{$_SESSION["prize_name"]}';
//                desc = '幸运儿{$_SESSION["nickname"]}赢得了{$_SESSION["prize_name"]}';
//                fenxiang(title,desc);

                    //返回首页
//                    location.href="{:U('Home/Index/index')}";
                    $('#no6').show();
                }else{
                    alert(data.msg);
//                    alert("信息填写不完整，请重新填写！");
                }
            },"json");
        }
        </script>



         <script>
$(document).ready(function() {
//初始化分享
        fenxiang("深呼吸体验之旅摄影作品大赛");
        function fenxiang(title,desc){
            //微信分享
            wx.config({
                debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
                appId: "{:C('APPID')}", // 必填，公众号的唯一标识
                timestamp: "{$wxKey['timestamp']}", // 必填，生成签名的时间戳
                nonceStr: "{$wxKey['noncestr']}", // 必填，生成签名的随机串
                signature: "{$wxKey['signature']}",// 必填，签名，见附录1
                jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage'] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
            });
            wx.ready(function () {
                var shareData = {
                    title: title,
                    desc: "有体验游，有奖品，有创业项目，只因他们是深呼吸粉丝！",
                    link: "http://tp.nidjia.com{:U('Home/Index/notice')}",
                    imgUrl: "{:C('APP_URL')}/Public/img/logo.jpg"
                };
                wx.onMenuShareAppMessage(shareData);
                wx.onMenuShareTimeline(shareData);
            });
            wx.error(function(res){
                alert(res.errMsg);
            });
        }
    $(".share").tap(function(){
        $(".wx-share").removeClass("hidden");
    });
    $(".wx-share").tap(function(){
        $(".wx-share").addClass("hidden");
    });
});

</script>
    </body>
</html>
     